package Offer2019;

import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class Test {

    public static void main(String[] args) throws ClassNotFoundException {
        Test test = new Test();
        List list = test.test();
       if (list instanceof ArrayList){
           ArrayList arrayList = (ArrayList) list;
           System.out.println("test");
       }
    }

    public List test(){
        return new ArrayList();
    }


    //public Test(){
    //    Class cs = this.getClass();
    //    Method[] methods = cs.getMethods();
    //    for (Method method : methods) {
    //        Type type = method.getGenericReturnType();
    //        System.out.println(type instanceof  ParameterizedType);
    //        ParameterizedType parameterizedType = (ParameterizedType) type;
    //    }
    //}
}
